/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CharacterView.java
 *
 * Created on 13.04.2011, 21:05:15
 */

package earthdawnnet.server.shareable.charactersheet;

import earthdawnnet.server.shareable.VisualRepresentation;
import earthdawnnet.util.IconProvider;
import java.awt.EventQueue;

/**
 *
 * @author Andreas Franek
 */
public class CharacterView extends VisualRepresentation<CharacterSheet> {

    /** Creates new form CharacterView */
    public CharacterView(CharacterSheet c) {
        super(c);
        initComponents();
        fillForm();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        appearanceSection1 = new earthdawnnet.server.shareable.charactersheet.AppearanceSection();
        generalSection1 = new earthdawnnet.server.shareable.charactersheet.GeneralSection();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setIconImage(IconProvider.provide());
        setName("Character sheet: " + getData().getName());

        appearanceSection1.setName("appearanceSection1"); // NOI18N

        generalSection1.setName("generalSection1"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(appearanceSection1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(generalSection1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(27, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(appearanceSection1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(generalSection1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static CharacterView startup(final CharacterSheet c) 
    {
        final CharacterView cv = new CharacterView(c);
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                cv.setVisible(true);
            }
        });
        return cv;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private earthdawnnet.server.shareable.charactersheet.AppearanceSection appearanceSection1;
    private earthdawnnet.server.shareable.charactersheet.GeneralSection generalSection1;
    // End of variables declaration//GEN-END:variables

    private void fillForm()
    {
        CharacterSheet c = getData();
    }

}
